#!/bin/sh -e
#
# Wait for all running udev processes to finish

while true; do
    running=$(cat /proc/*/status 2> /dev/null | grep -c -E '^Name:.udevd?$')
    if [ $running -gt 1 ]; then
	sleep 0.5
    else
	exit 0
    fi
done
